﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;

namespace GataBaseSys
{
    public partial class UserXiu : System.Web.UI.Page
    {
        SignInBLL bll = new SignInBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int ids=  Convert.ToInt32(Session["uid"]);
                SignIn si = bll.Sid(ids);
                this.username.Value = si.SignInName;
                this.userpwd.Value = si.SignInPwd;
                this.userzhuang.Value = si.SignInState;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            SignIn sid = new SignIn();
            sid.SignInID = Convert.ToInt32(Session["uid"]);
            sid.SignInName = this.username.Value.Trim();
            sid.SignInPwd = this.userpwd.Value.Trim();
            sid.SignInState = this.userzhuang.Value.Trim();
            if (bll.UpdateSin(sid))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(),"", "<script>alert('修改成功')</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('实名相同')</script>");
            }
           
        }
    }
}